namespace Roids.SL
{
    using Framework;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;

    public class ShipThrust : ParticleEmitter
    {
        private readonly Game _game;

        private Texture2D _sprite;

        public ShipThrust(Game game) : base(game)
        {
            _game = game;

            AddParticle(new Particle {Life = 10});
            AddParticle(new Particle {Life = 10});
            AddParticle(new Particle {Life = 10});
        }

        public override void LoadContent()
        {
            _sprite = _game.Content.Load<Texture2D>(@"Content\Sprites\thrustball");
            base.LoadContent();
        }

        protected override void DrawParticle(GameTime gameTime, SpriteBatch spriteBatch, Particle particle)
        {
            var dest = new Rectangle((int) particle.X, (int) particle.Y, 16, 16);
            spriteBatch.Draw(_sprite, dest, Color.White);
        }
    }
}